﻿using NodeCanvas.Framework;
using ParadoxNotion.Design;

namespace Yoozoo.Gameplay.Liberty.AI.Node
{
    [Category("Ggame/Liberty")]
    public class PlayAnimCrossFade : AIBaseNode
    {
        [RequiredField]
        public BBParameter<string> stateName;
        public BBParameter<float> normalizedTransitionDuration;
        public BBParameter<int> layer;
        public BBParameter<float> normalizedTimeOffset;
        public BBParameter<float> normalizedTransitionTime;
        
        protected override void OnExecute()
        {
            _animator.CrossFade(stateName.value,
                normalizedTransitionDuration.value,
                layer.value,
                normalizedTimeOffset.value,
                normalizedTransitionTime.value);
            EndAction(true);
        }
    }
}